package com.aaa.ssm.util;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class AjaxResult {
    private  int code;
    private  String msg;
    private  Object data;

    public static AjaxResult success(int code,String msg){
        return  new AjaxResult(code,msg,null);
    }
    public static AjaxResult success(int code,String msg,Object obj){
        return  new AjaxResult(code,msg,obj);
    }
    public static AjaxResult error(int code,String msg){
        return  new AjaxResult(code,msg,null);
    }
    public static AjaxResult error(int code,Object data){
        return  new AjaxResult(code,null,data);
    }
    public static AjaxResult error(int code,String msg,Object obj){
        return  new AjaxResult(code,msg,obj);
    }
}
